Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use microphysics EOS in Quokka's EOS.hpp for all quokka tests + use amu instead of hydrogen mass throughout Quokka #324

Merged
merged 74 commits into from
Jul 26, 2023

Conversation

psharda
Copy link
Contributor

@psharda psharda commented Jun 22, 2023

@BenWibking , look at this test change I made to EOS.hpp: for tests other than primordial chem, now, I want to use microphysics EOS to ComputeTgasFromEint. I create a burn_t object, add the density, Eint and mean_molecular_weight to it, and then use the eos(eos_input_re, ...) call to find the temperature.

While compiling a test that actually uses ComputeTgasFromEint (e.g., HydroShocktubeCMA), I get these errors:

[ 38%] Linking CXX executable test_hydro_shocktube_cma
CMakeFiles/test_hydro_shocktube_cma.dir/test_hydro_shocktube_cma.cpp.o: In function `HydroSystem<ShocktubeProblem>::EnforceLimits(double, double, double, double, double, amrex::MultiFab&)::{lambda(int, int, int, int)#1}::operator()(int, int, int, int) const':
test_hydro_shocktube_cma.cpp:(.text._ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii[_ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii]+0x22f): undefined reference to `EOSData::initialized'
test_hydro_shocktube_cma.cpp:(.text._ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii[_ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii]+0x252): undefined reference to `eos_rp::eos_assume_neutral'
test_hydro_shocktube_cma.cpp:(.text._ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii[_ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii]+0x26a): undefined reference to `EOSData::mine'
test_hydro_shocktube_cma.cpp:(.text._ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii[_ZZN11HydroSystemI16ShocktubeProblemE13EnforceLimitsEdddddRN5amrex8MultiFabEENKUliiiiE_clEiiii]+0x278): undefined reference to `EOSData::maxe'

I think the reason behind these errors is that I haven't initialized the microphysics eos and extern_parameters. In primordial chem test, I do init_extern_parameters() and eos_init() to initialize them. My question is, where should I carry out this initialization for other tests? In their respective test.cpp files? Or, in EOS.hpp itself?

@psharda psharda requested a review from BenWibking June 22, 2023 15:15
@BenWibking
Copy link
Collaborator

This is a linking issue. It looks like the necessary EOS .cpp files aren't being linked into the binary, so these functions don't exist when it tries to link it together.

@BenWibking
Copy link
Collaborator

Hopefully it's just a missing *.cpp file. However, it can be something more exotic, in which case it is unfortunately necessary to understanding how the linker works in some detail.

If you are in the latter situation, I would recommend reading this: https://www.lurklurk.org/linkers/linkers.html.

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

/azp run

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

/azp run

@BenWibking
Copy link
Collaborator

Can you add a new *.rst file in docs/ that explains what mass_code_units is?

Since the rest of us were confused about this on the call, I think new users will be very confused without some documentation.

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

We don't need mass_code_units anymore (I thought that was clear from the discussion?). Anyway I will push a commit soon.

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

/azp run

@azure-pipelines
Copy link

No commit pushedDate could be found for PR 324 in repo quokka-astro/quokka

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

/azp run

@psharda
Copy link
Contributor Author

psharda commented Jul 25, 2023

this is ready @BenWibking

@BenWibking
Copy link
Collaborator

I'll take a look this afternoon.

@BenWibking
Copy link
Collaborator

Looks good, except for the last remaining mass_code_units that can be deleted.

Automerge enabled.

@BenWibking
Copy link
Collaborator

BenWibking commented Jul 25, 2023

This does seem a bit slower than usual.

/usr/bin/cmake -E chdir . ctest -E MatterEnergyExchange* -T Test --output-on-failure
   Site: avatargpue.anu.edu.au
   Build name: Linux-g++
Create new tag: 20230725-1425 - Experimental
Test project /avatar/bwibking/azure-pipelines-agent/_work/4/s/build
      Start  1: HydroShocktubeCMA
 1/28 Test  #1: HydroShocktubeCMA ................   Passed  915.15 sec
      Start  2: PrimordialChem
 2/28 Test  #2: PrimordialChem ...................   Passed    2.53 sec
      Start  3: ScalarAdvection
 3/28 Test  #3: ScalarAdvection ..................   Passed    8.05 sec
      Start  4: Advection2D
 4/28 Test  #4: Advection2D ......................   Passed   46.84 sec
      Start  5: ScalarAdvectionSemiEllipse
 5/28 Test  #5: ScalarAdvectionSemiEllipse .......   Passed    7.94 sec
      Start  6: HydroBlast3D
 6/28 Test  #6: HydroBlast3D .....................   Passed  736.15 sec
      Start  7: HydroContact
 7/28 Test  #7: HydroContact .....................   Passed    2.99 sec
      Start  8: HydroLeblanc
 8/28 Test  #8: HydroLeblanc .....................   Passed   59.05 sec
      Start  9: HydroShocktube
 9/28 Test  #9: HydroShocktube ...................   Passed   86.79 sec
      Start 10: ShuOsher
10/28 Test #10: ShuOsher .........................   Passed   30.77 sec
      Start 11: HydroSlowMovingShock
11/28 Test #11: HydroSlowMovingShock .............   Passed    8.35 sec
      Start 12: HydroVacuum
12/28 Test #12: HydroVacuum ......................   Passed    2.52 sec
      Start 13: HydroWave
13/28 Test #13: HydroWave ........................   Passed    3.26 sec
      Start 14: HydroQuirk
14/28 Test #14: HydroQuirk .......................   Passed    3.49 sec
      Start 15: HydroHighMach
15/28 Test #15: HydroHighMach ....................   Passed    2.60 sec
      Start 16: RadForce
16/28 Test #16: RadForce .........................   Passed   57.97 sec
      Start 17: MarshakWave
17/28 Test #17: MarshakWave ......................   Passed    7.43 sec
      Start 18: MarshakWaveCGS
18/28 Test #18: MarshakWaveCGS ...................   Passed    3.74 sec
      Start 19: RadiationPulse
19/28 Test #19: RadiationPulse ...................   Passed   38.29 sec
      Start 20: RadiationStreaming
20/28 Test #20: RadiationStreaming ...............   Passed    4.80 sec
      Start 21: SuOlsonTest
21/28 Test #21: SuOlsonTest ......................   Passed   12.78 sec
      Start 22: RadiationPressureTube
22/28 Test #22: RadiationPressureTube ............   Passed   11.76 sec
      Start 23: RadhydroShock
23/28 Test #23: RadhydroShock ....................   Passed  119.09 sec
      Start 24: RadhydroShockCGS
24/28 Test #24: RadhydroShockCGS .................   Passed  128.29 sec
      Start 25: ODEIntegration
25/28 Test #25: ODEIntegration ...................   Passed    2.40 sec
      Start 26: PassiveScalar
26/28 Test #26: PassiveScalar ....................   Passed   47.20 sec
      Start 27: FCQuantities
27/28 Test #27: FCQuantities .....................   Passed    2.46 sec
      Start 28: SphericalCollapse
28/28 Test #28: SphericalCollapse ................   Passed  199.84 sec

100% tests passed, 0 tests failed out of 28

Total Test time (real) = 2553.28 sec

@psharda
Copy link
Contributor Author

psharda commented Jul 26, 2023

This does seem a bit slower than usual.

/usr/bin/cmake -E chdir . ctest -E MatterEnergyExchange* -T Test --output-on-failure
   Site: avatargpue.anu.edu.au
   Build name: Linux-g++
Create new tag: 20230725-1425 - Experimental
Test project /avatar/bwibking/azure-pipelines-agent/_work/4/s/build
      Start  1: HydroShocktubeCMA
 1/28 Test  #1: HydroShocktubeCMA ................   Passed  915.15 sec
      Start  2: PrimordialChem
 2/28 Test  #2: PrimordialChem ...................   Passed    2.53 sec
      Start  3: ScalarAdvection
 3/28 Test  #3: ScalarAdvection ..................   Passed    8.05 sec
      Start  4: Advection2D
 4/28 Test  #4: Advection2D ......................   Passed   46.84 sec
      Start  5: ScalarAdvectionSemiEllipse
 5/28 Test  #5: ScalarAdvectionSemiEllipse .......   Passed    7.94 sec
      Start  6: HydroBlast3D
 6/28 Test  #6: HydroBlast3D .....................   Passed  736.15 sec
      Start  7: HydroContact
 7/28 Test  #7: HydroContact .....................   Passed    2.99 sec
      Start  8: HydroLeblanc
 8/28 Test  #8: HydroLeblanc .....................   Passed   59.05 sec
      Start  9: HydroShocktube
 9/28 Test  #9: HydroShocktube ...................   Passed   86.79 sec
      Start 10: ShuOsher
10/28 Test #10: ShuOsher .........................   Passed   30.77 sec
      Start 11: HydroSlowMovingShock
11/28 Test #11: HydroSlowMovingShock .............   Passed    8.35 sec
      Start 12: HydroVacuum
12/28 Test #12: HydroVacuum ......................   Passed    2.52 sec
      Start 13: HydroWave
13/28 Test #13: HydroWave ........................   Passed    3.26 sec
      Start 14: HydroQuirk
14/28 Test #14: HydroQuirk .......................   Passed    3.49 sec
      Start 15: HydroHighMach
15/28 Test #15: HydroHighMach ....................   Passed    2.60 sec
      Start 16: RadForce
16/28 Test #16: RadForce .........................   Passed   57.97 sec
      Start 17: MarshakWave
17/28 Test #17: MarshakWave ......................   Passed    7.43 sec
      Start 18: MarshakWaveCGS
18/28 Test #18: MarshakWaveCGS ...................   Passed    3.74 sec
      Start 19: RadiationPulse
19/28 Test #19: RadiationPulse ...................   Passed   38.29 sec
      Start 20: RadiationStreaming
20/28 Test #20: RadiationStreaming ...............   Passed    4.80 sec
      Start 21: SuOlsonTest
21/28 Test #21: SuOlsonTest ......................   Passed   12.78 sec
      Start 22: RadiationPressureTube
22/28 Test #22: RadiationPressureTube ............   Passed   11.76 sec
      Start 23: RadhydroShock
23/28 Test #23: RadhydroShock ....................   Passed  119.09 sec
      Start 24: RadhydroShockCGS
24/28 Test #24: RadhydroShockCGS .................   Passed  128.29 sec
      Start 25: ODEIntegration
25/28 Test #25: ODEIntegration ...................   Passed    2.40 sec
      Start 26: PassiveScalar
26/28 Test #26: PassiveScalar ....................   Passed   47.20 sec
      Start 27: FCQuantities
27/28 Test #27: FCQuantities .....................   Passed    2.46 sec
      Start 28: SphericalCollapse
28/28 Test #28: SphericalCollapse ................   Passed  199.84 sec

100% tests passed, 0 tests failed out of 28

Total Test time (real) = 2553.28 sec

Yes, I found that too. I actually commented about it earlier but then edited my comment thinking it was probably a Gadi thingy, because on avatar it doesn't take any longer than before.

@psharda psharda requested a review from BenWibking July 26, 2023 07:43
@psharda
Copy link
Contributor Author

psharda commented Jul 26, 2023

/azp run

@azure-pipelines
Copy link

No commit pushedDate could be found for PR 324 in repo quokka-astro/quokka

@psharda
Copy link
Contributor Author

psharda commented Jul 26, 2023

/azp run

@psharda
Copy link
Contributor Author

psharda commented Jul 26, 2023

Ready to be merged @BenWibking

@BenWibking BenWibking added this pull request to the merge queue Jul 26, 2023
Merged via the queue into quokka-astro:development with commit aa288b5 Jul 26, 2023
8 checks passed
@psharda psharda deleted the micro-max branch July 31, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why is the mean molecular weight not consistent between all tests?
2 participants